package basic

import (
	"time"
	"github.com/garyburd/redigo/redis"
)

func RedisConn() (redis.Conn, error) {
	conn, err := redis.DialTimeout("tcp", Config.Redis.Addr, 0, 1 * time.Second, 1 * time.Second)
	if err != nil {
		logger := Logger{}
		logger.WriteMsg("error", "Read:failed to connect database")
		return nil, err
	}
	return conn, nil
}
